package com.stylefeng.guns.rest.modular.scheduled;

import com.stylefeng.guns.rest.modular.artitle.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@Component
@EnableScheduling
public class ScheduledTask {
    @Autowired
    private ArticleService articleService;
    ////    每天凌晨三点启动
    @Scheduled(cron = "0 0/10 * * * ?")
    public void taskChangeSyllabusStatus(){
        System.out.println("=========>>>>>>>>定时任务执行"+new SimpleDateFormat("HH:mm:ss").format(new Date()));
        articleService.updateSSOUrl();
    }

    //更改状态
    /*@Scheduled(cron = "0 0/5 * * * ?")
    public void taskChangeOneToOneCourseState(){
        System.out.println("=========>>>>>>>>测试修改状态执行"+new SimpleDateFormat("HH:mm:ss").format(new Date()));

    }*/


}
